syntax errors in perl

syntax errors in perl

am 26.08.2009 18:59:52 von beegee beegee

--===============1994494241==
Content-Type: multipart/alternative; boundary=0016368e21c02dd19604720e612a

--0016368e21c02dd19604720e612a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi, I am running PERL (v5.8.6) on a mac os x 10.4.11.I am a complete
newcomer to PERL
I was referring to the book
"PERL programming for the absolute beginner" by Jerry Lee Ford Jr.
I tried to run this code from the book (code is in green font)
#! /usr/bin/perl -w
#
# JokeMachine.pl

clear_the_screen();

$reply = " "
while ($reply ne 'yes') {
print 'Would you like to hear a joke? (yes/no): ' ;
chomp($reply = );
if($reply ne 'yes') {
print "\n Hum.......Perhaps you misunderstood \n\n";
}
}
clear_the_screen();

print "\n What disappears the moment you say it's name? \n\n";
chomp($reply = );
if (reply ne 'silence') {
print "\n Sorry. Wrong Answer\n";
} else {
print "\n Yes that is the right answer\n\n";
}
*and got the following error (Note: pe was on a line above rl JokeM.....)*

--0016368e21c02dd19604720e612a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, I am running PERL (v5.8.6) on a =A0mac os x 10.4.11.

I am a complet=
e newcomer to PERL
I was referring to the book
=A0"=
;PERL programming for the absolute beginner" by Jerry Lee Ford Jr. v>
I tried to run this code from the book (code is in green font)
iv>=A0 erif"> 255, 255);">#! /usr/bin/=
perl -w

rif"> 55, 255);"># n>

rif"> 55, 255);"># JokeMachine=
..pl

rif"> 55, 255);">
span>

rif"> 55, 255);">clear_the_scr=
een();

rif"> 55, 255);">
span>

rif"> 55, 255);">$reply =3D &q=
uot; "

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> =
=
55);">while ($reply ne &=
#39;yes') =A0{

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> > > 255);">print 'Would =
you like to hear a joke? (yes/no): =A0 ' ;

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> > > 255);">chomp($reply =3D =
<STDIN>);

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> >

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> > > 255);">if($reply ne '=
;yes') {

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> n> "> 255);">print "\n H=
um.......Perhaps you misunderstood \n\n";

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> =
=
55);"> =A0 =A0} span>

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> =
=
55);">} ont>

rif"> 55, 255);">clear_the_scr=
een();

rif"> 55, 255);">
span>

rif"> 55, 255);">print "\=
n What disappears the moment you say it's name? \n\n";
n>

rif"> 55, 255);">chomp($reply =
=3D <STDIN>);

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> =
=
55);">if (reply ne '=
silence') {

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> > > 255);">print "\n So=
rry. =A0Wrong Answer\n";

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> =
=
55);">} else { pan>

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> > > 255);">print "\n Ye=
s that is the right answer\n\n";

=3D"Apple-style-span" face=3D"'times new roman', serif"> =3D"Apple-style-span" style=3D"background-color: rgb(255, 255, 255);"> class=3D"Apple-style-span" color=3D"#003300"> n> "> 255);">}<=
/font>

, 255, 0);">and got the following error (Note: pe was on a line above rl Jo=
keM.....)

/C071DFA0-1E50-4DD1-9B04-208441A9A75D/image.tiff">





--0016368e21c02dd19604720e612a--

--===============1994494241==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1994494241==--